<?php
header("content-type:text/html;charset=utf-8");
session_start();
if($_SESSION['admin']!=""){
	include("../conn/conn.php");
	$id=$_GET['id'];
	
	$sql="select * from tb_manager where id=".$id;
	$result=mysqli_query($link,$sql);
	
	if(mysqli_num_rows($result)>0){
	$rows_whe=mysqli_fetch_assoc($result);
	if($rows_whe['whether']=="1"){
	$sql_up="update tb_manager set whether='0' where id=".$id;
	}
	else{
		$sql_up="update tb_manager set whether='1' where id=".$id;
		}
	mysqli_query($link,$sql_up);
	echo "<script>alert('状态修改成功');location='admin_manager.php';</script>";
}
else{
	echo "<script>alert('没有这条记录');</script>";
	}
	}
	else{
		echo "<script>alert('请登陆再管理');location='index.php';</script>";
		
		}
?>